<?php echo $html->css('slides/style6'); ?>
<?php echo $html->script(array('slides/jquery.easing', 'slides/script')); ?>

<script type="text/javascript">
$('.slide-news').corner();
$(document).ready( function(){	
		var buttons = { previous:$('#lofslidecontent45 .lof-previous') ,
						next:$('#lofslidecontent45 .lof-next') };
						
		$obj = $('#lofslidecontent45').lofJSidernews( { interval : 4000,
												direction		: 'opacity',	
											 	easing			: 'easeOutBounce',
												duration		: 1200,
												auto		 	: true,
												mainWidth:600,
												buttons			: buttons} );	
	});
</script>
<div class="slide-news">
	<div id="lofslidecontent45" class="lof-slidecontent" style="width:600px; height:340px; margin: 0 auto;">
		<div class="preload"><div></div></div>
		<!-- MAIN CONTENT --> 
		<div class="lof-main-outer" style="width:600px; height:340px;">
		<div onclick="return false" href="" class="lof-previous">Previous</div>
		<ul class="lof-main-wapper">
			<?php foreach ($hot_news as $p) {?>
			<li>
				<?php echo $html->image('news/' . $p['Post']['hot_img'], array(
					'width'=>'600px', 'height'=>'340px', 'title' => $p['Category']['category'],
					'url' => array('action'=>'view', $p['Post']['id'])
				)); ?>
				<div class="lof-main-item-desc">
					<h3><?php echo $html->link('/' . $p['Category']['category'] . '/', array(
						'action'=>'cat', $p['Post']['category_id']
						),
						array('target'=>'_parent')
					); echo '<i> - ' . $p['Post']['created'] . '</i>'; ?>
					</h3>
					<h2><?php echo $p['Post']['title'] ?></h2>
					<p>
						<?php
							echo $p['Post']['summary'];
							echo $html->link('Đọc tiếp', array('action'=>'view', $p['Post']['id']), array('class'=>'readmore'));
						?>
						
					</p>
				</div>
			</li>
			<?php } ?>
		</ul>  	
		<div onclick="return false" href="" class="lof-next">Next</div>
		</div>
	</div>
</div>
<?php foreach ($posts as $post) { 
	$max = count($post['listpost']);
	if($max > 0) {
	?>
<div class="content-box">
	<div class="content-header"><h3><?php echo $html->link($post['category'], array('action'=>'cat', $post['cat_id']));?></h3></div>
	<div class="content-main">
		<?php 
			$count = 0;
			
			foreach ($post['listpost'] as $p) {
				$count++; 
				if($count ==1 ) {
			?>
		
		<div class="top-news">
			<div class="tn-img">
				<?php echo $html->image('news/thumb_' . $p['Post']['image'], array(
					'width'=>'130px', 'height'=>'100px',
					'url' => array('action'=>'view', $p['Post']['id'])	
				));
				?>
			</div>
			<p><?php echo $html->link($p['Post']['title'], array(
					'action'=>'view', $p['Post']['id']
					),
					array('class'=>'tn-title')
					); 
				?>
			</p>
			<p>
				<?php echo $p['Post']['summary']; ?>
			</p>
		</div>
		
		<div class="other-news">
			<ul>
			<?php } else if($count <= $max) { ?>
				<li><?php echo $html->link($p['Post']['title'], array(
					'action'=>'view', $p['Post']['id']
					));?>
				</li>
				<?php } if($count == $max) { ?>
				
			</ul>
		</div>
		<?php }} ?>
	</div>
</div>
<?php } } ?>